import React from 'react';

import Constants from '../../common/Constants';
import BaseAction from '../common/BaseAction';
import ResponseConstants from '../../common/ResponseConstants';

export default class QZ_ReportPostOrCommetAction extends BaseAction {
  constructor() {
    super();

    this.moduleType = Constants.MODULE_TYPE.QUAN_ZI;
    this.name = "QZ_ReportPostOrCommetAction";
  }

  call(caller, data) {
    this._baseCall(caller, data);
    this.caller.setState({
      reportStatus: 2,
    })
  }

  finish(data, isSucceed) {
    if(isSucceed) {
      if(data.status == 200 || data.status == ResponseConstants.status_deal_success) {
        reportStatus = 3;
        statusText='提交成功'
      }
      else {
        reportStatus = 1;
        statusText='提交失败'
      }
    }
    else {
      reportStatus = 1;
      statusText='提交失败'
    }
    this.caller.setState({
      reportStatus: reportStatus,
      needRefresh: true,
      statusText:statusText,
    })
  }
}
